<template>
  <div>
    <ul>
      <li v-for="item in dataList" :key="item.id" 
      @click=" $router.push(`/listdetail/${item.houseCode}`)"
      >
        <div>
          <img :src="'http://www.xiaoshuaipeng.com:8080' + item.houseImg" alt="" />
        
        </div>
        <div>
         <p>111</p>
          <p>{{ item.desc}}</p>
          <p>{{ item.tags[0]}}</p>
          <p>{{ item.price}}</p>
          <p>{{ item.title}}</p>
          <p>{{ item.houseCode}}</p>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      dataList: [],
    };
  },

  async created() {
  //   const { data } = await axios.get(
  //     "http://www.xiaoshuaipeng.com:8080/area/city",
  //     {
  //       params: {
  //         level: 1,
  //       },
  //     }
  //   );
  //   console.log(data.body);
  //   this.dataList = "AREA|88cff55c-aaa4-e2e0";

    const  {data} = await axios.get("http://www.xiaoshuaipeng.com:8080/houses",
      {
        params: {
          cityId: "AREA|88cff55c-aaa4-e2e0",
        },
      }
    );
    console.log(data.body.list);
    this.dataList = data.body.list
  },
};
</script>

<style scoped lang="less">
* {
  margin: 0;
  padding: 0;
}
ul {
  list-style: none;
  li {
    border-bottom: 2px solid #fff222;
    display: flex;
    img {
      width:100px;
      height: 100px;
    }
  }
}
</style>